package org.cst8277.ums.nas.listeners;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.cst8277.ums.nas.entity.DeviceInfo;

import java.util.List;

@Slf4j
@Data
public class DeviceInfoListener extends AnalysisEventListener<DeviceInfo> {
    private List<DeviceInfo> deviceInfoList = Lists.newArrayList();

    @Override
    public void invoke(DeviceInfo deviceInfo, AnalysisContext analysisContext) {
        log.info("deviceInfo:{}", deviceInfo);
        this.deviceInfoList.add(deviceInfo);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("[设备落位]数据读取完成");
    }
}
